package com.example.onedemotest.slice;

import com.example.onedemotest.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.TabList;

public class TabListSlice extends AbilitySlice {
    private TabList tabList;
    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        setUIContent(ResourceTable.Layout_tablist_slice_layout);
        tabList= (TabList) findComponentById(ResourceTable.Id_tabList);

        for (int i=0;i<20;i++){
            TabList.Tab tab = tabList.new Tab(getContext());
            tab.setText("tab"+i);
            tabList.addTab(tab);
        }
    }
}
